package com.telnikoff.gf;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

public class DefaultGfMenuBranch implements GfMenuBranch
{
	private final List<GfMenuNode> nodes;
	private final String name;
	
	protected DefaultGfMenuBranch(String name)
	{
		this.name = name;
		nodes = new ArrayList<GfMenuNode>();
	}

	@Override
	public void add(GfMenuBranch branch) 
	{
		nodes.add(branch);
	}

	@Override
	public void add(GfMenuLeaf leaf) 
	{
		nodes.add(leaf);
	}

	@Override
	public String getName() 
	{
		return name;
	}

	@Override
	public Collection<GfMenuNode> getNodes() 
	{
		return nodes;
	}

}
